package net.htjs.jdkgrammer.jdk11;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class StringTest {

    public static void main(String[] args) {
        //strip方法，可以去除首尾空格，与之前的trim的区别是还可以去除unicode编码的空白字符
        char c = '\u2000';//Unicdoe空白字符
        String str = c + "abc" + c;
        log.info("strip()结果: {}", str.strip());
        log.info("trim()结果: {}", str.trim());
        log.info("stripLeading()结果: {}", str.stripLeading());
        log.info("stripTrailing()结果: {}", str.stripTrailing());

        String str1 = " ";
        log.info("空字符串isBlank(): {}", str1.isBlank());
    }
}
